<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page
	import="java.util.ArrayList, com.TEAM6.beans.BookInfo, com.TEAM6.beans.NoticeInfo"%>
<%
	String pagefile = request.getParameter("page");
	if (pagefile == null) {
		pagefile = "initpage";
	}
	if(session==null)response.sendRedirect("./index.jsp");
	ArrayList<BookInfo> rlist1 = (ArrayList) request
			.getAttribute("rentallist");
	ArrayList<BookInfo> rlist2 = (ArrayList) request
			.getAttribute("delaylist");
	ArrayList<BookInfo> rlist3 = (ArrayList) request
			.getAttribute("bookinglist");
	ArrayList<NoticeInfo> list4 = (ArrayList) request
			.getAttribute("noticelist");
	ArrayList<NoticeInfo> list5 = (ArrayList) request
			.getAttribute("freeboardlist");
	
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Library</title>
<script language="javascript" src="../JS/Book.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../CSS/Book.css">
</head>
<body>
<form name="search" action="search.zzang" method="post">
	<div id="head">
		<div id="headleft">Books Rental</div>
		
	</div>
	<div id="trunk">
		<table width="960" border="1" align="center">
			<tr>
				<td rowspan=2 width=250px><div id="info">
						<div id="titlefont">[회원정보]</div>
						
						<br> <a href="modifyMemberInfo.jsp" class="a_color">정보수정</a><br> <br>
						<a href="mypage.jsp" class="a_color">마이페이지</a><p>
						<div onMouseOver="rentalblock()" onMouseOut="rentalnone()" class="h_font">
							대여권수 :<%=rlist1.size()%></div>
						<br>
						<div onMouseOver="delayblock()" onMouseOut="delaynone()" class="h_font">
							연체권수 :
							<%=rlist2.size()%></div>
						<br>
						<div onMouseOver="bookingblock()" onMouseOut="bookingnone()" class="h_font">
							예약권수 :
							<%=rlist3.size()%></div>
						<br>
						<div id="rental">
							<table>
								<tr>
									<td>제목</td>
									<td>반납일</td>
									<td>도서관</td>
								</tr>
								<%
									for (int i = 0; i < rlist1.size(); i++) {
								%>
								<tr>
									<td><%=rlist1.get(i).getName()%></td>
									<td><%=rlist1.get(i).getReturndate()%></td>
									<td><%=rlist1.get(i).getName()%></td>
								</tr>
								<%
									}
								%>
							</table>
						</div>
						<div id="delay">
							<table>
								<tr>
									<td>제목</td>
									<td>반납일</td>
									<td>도서관</td>
								</tr>
								<%
									for (int i = 0; i < rlist2.size(); i++) {
								%>
								<tr>
									<td><%=rlist2.get(i).getName()%></td>
									<td><%=rlist2.get(i).getReturndate()%></td>
									<td><%=rlist2.get(i).getName()%></td>
								</tr>
								<%
									}
								%>
							</table>
						</div>
						<div id="booking">
							<table>
								<tr>
									<td>제목</td>
									<td>예약일</td>
									<td>도서관</td>
								</tr>
								<%
									for (int i = 0; i < rlist3.size(); i++) {
								%>
								<tr>
									<td><%=rlist3.get(i).getName()%></td>
									<td><%=rlist3.get(i).getBookingdate()%></td>
									<td><%=rlist3.get(i).getName()%></td>
								</tr>
								<%
									}
								%>
							</table>
						</div>
					</div></td>
				<td colspan=2 height=250px width=550px><div id="notice">
						<div id="titlefont">[공지사항]</div><br>

						<table id="table" border="1" bordercolor="skyblue">
							<tr>
								<td class="center" >글번호</td>
								<td class="center">제목</td>
								<td class="center">내용</td>
							</tr>
							<%
								for (int i = 0; i < list4.size(); i++) {
							%>
							<tr>
								<td class="center"><%=list4.get(i).getNumber()%></td>
								<td><div style="width:150px; text-overflow:ellipsis; overflow:hidden;">
								<nobr><%=list4.get(i).getTitle()%></nobr></div></td>
								<td><div style="width:330px; text-overflow:ellipsis; overflow:hidden;">
								<nobr><%=list4.get(i).getContext()%></nobr></div></td>
							</tr>
							<%
								}
							%>
						</table>

					</div>
			<tr>
				<td height=250px width=250px><div id="AD">
						<div id="titlefont">[이달의 추천도서]</div>
						<br>
						<center>
							<img src="d://1.jpg" width=200px height=240px>
						</center>
					</div></td>
				<td rowspan=2 height=550px width=250px><div id="search">


						<div id="c2">

							<div id="titlefont">
								<span class="bold">[도서 검색]</span>
							</div>

							<div class="hspace"></div>

							<div>
								<select>
									<option>전체</option>
									<option>도서명</option>
									<option>저자명</option>
									<option>출판사</option>
								</select>
							</div>

							<div class="hspace"></div>

							<div>
								
								<input id="searchtxt" name="searchtxt"type="text" class="box_l" />
							
							</div>
							<div class="hspace"></div>
							<div>
								<input type="button" class="box_s" value="검색" onClick="searchJS()"/>
							
							</div>
							<div class="hspace"></div>

							<textarea cols="31" rows="13"></textarea>


						</div>
						<!-- c2 -->

						<!-- c1 -->


					</div></td>
			</tr>
			<tr>
				<td colspan=2 height=250px width=550px><div id="board">
						<div id="titlefont">[자유게시판]</div><br>
						<table id="table" border="1" bordercolor="skyblue">
							<tr>
								<td id="t_width" class="center">글번호</td>
								<td class="center">제목</td>
								<td class="center">내용</td>
							</tr>
							<%
								for (int i = 0; i < list5.size(); i++) {
							%>
							<tr>
								<td class="center"><%=list5.get(i).getNumber()%></td>
								<td><div style="width:150px; text-overflow:ellipsis; overflow:hidden;">
								<nobr><%=list5.get(i).getTitle()%></nobr></div></td>
								<td><div style="width:330px; text-overflow:ellipsis; overflow:hidden;">
								<nobr><%=list5.get(i).getContext()%></nobr></div></td>
							</tr>
							<%
								}
							%>
						</table>
					</div></td>
			</tr>
		</table>
	</div>
	</form>
	</body>